package cn.fookey.commonres.base;
import android.content.Context;
import android.os.Bundle;

import com.alibaba.android.arouter.launcher.ARouter;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewbinding.ViewBinding;
/**
 * Create by zyx on 2021/6/22
 * If they throw stones at you, don’t throw back, use them to build your own foundation instead.
 */
public abstract class firstBaseActivity<T extends ViewBinding> extends AppCompatActivity {
    protected T bingView;
    protected Context context;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        bingView=getBinding();
        setContentView(bingView.getRoot());
        context = this;
        ARouter.getInstance().inject(this);
        inItData();
    }
    protected abstract T getBinding();
    protected abstract void inItData();

    //    @Override
//    protected void onStart() {
//        super.onStart();
//        on_Start();
//    }
//    @Override
//    protected void onRestart() {
//        super.onRestart();
//        on_Restart();
//    }
    @Override
    protected void onResume() {
        super.onResume();
        on_Resume();
    }
    //    @Override
//    protected void onPause() {
//        super.onPause();
//        on_Pause();
//    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        on_Destroy();
        bingView = null ;
    }
    //    @Override
//    protected void onNewIntent(Intent intent) {
//        super.onNewIntent(intent);
//        on_NewIntent(intent);
//    }
//    protected abstract void on_Start();
//    protected abstract void on_Restart();
    protected abstract void on_Resume();
    //    protected abstract void on_Pause();
    protected abstract void on_Destroy();
//    protected abstract void on_NewIntent(Intent intent);
}
